﻿using Microsoft.Practices.Unity;
using RialternativeSample.Client.Helpers;
using RialternativeSample.Client.Northwind;
using RialternativeSample.Client.Northwind.Interfaces;
using RialternativeSample.Client.Views;
using RialternativeSample.Server.NorthwindService;
using RialternativeSample.Services;
using RialternativeSample.Services.Interfaces;
using RialternativeSample.ViewModels;
using RialternativeSample.ViewModels.Interfaces;
using RialternativeSample.Views.Interfaces;
namespace RialternativeSample
{
    public static class Bootstrapper
    {
        public static void Configure()
        {
            UnityHelper.UnityContainer.RegisterType<NorthwindContext>(new ContainerControlledLifetimeManager(), new InjectionConstructor());
            UnityHelper.UnityContainer.RegisterType<ILoginView, LoginView>();
            UnityHelper.UnityContainer.RegisterType<IMainViewModel, MainViewModel>();
            UnityHelper.UnityContainer.RegisterType<ILoginViewModel, LoginViewModel>();
            UnityHelper.UnityContainer.RegisterType<ICustomersViewModel, CustomersViewModel>();
            UnityHelper.UnityContainer.RegisterType<IProductsViewModel, ProductsViewModel>();
            UnityHelper.UnityContainer.RegisterType<IEmployeesViewModel, EmployeesViewModel>();
            UnityHelper.UnityContainer.RegisterType<ICustomersDataService, CustomersDataService>(new ContainerControlledLifetimeManager());
            UnityHelper.UnityContainer.RegisterType<IProductsDataService, ProductsDataService>(new ContainerControlledLifetimeManager());
            UnityHelper.UnityContainer.RegisterType<IEmployeesDataService, EmployeesDataService>(new ContainerControlledLifetimeManager());
            UnityHelper.UnityContainer.RegisterType<IDialogService, DialogService>(new ContainerControlledLifetimeManager());
        }
    }
}
